import Layer from "./lazy.js";
import LazyComponent from "./lazy-compont.js";
export default {
    install(Vue, options = {}) {
        const LazyClass = Layer(Vue);
        const lazy = new LazyClass(options);
         Vue.prototype.$Lazyload = lazy
         Vue.component('lazy-component', LazyComponent(lazy))
        Vue.directive('lazy', {
            bind: lazy.add.bind(lazy),
            update: lazy.update.bind(lazy),
            componentUpdated: lazy.lazyLoadHandler.bind(lazy),
            unbind: lazy.remove.bind(lazy)
        })

    }
}
